#define _CRT_SECURE_NO_WARNINGS 1


#include<vector>
#include<string>
#include<iostream>

using namespace std;

int main()
{
	int n = 0;
	cin >> n;
	vector<string> v(n);
	for (int i = 0; i < n; i++)
	{
		cin >> v[i];
	}
	string s;
	cin >> s;

	int count = 0;
	for (auto& e : v)
	{
		if (e == s)
		{
			count++;
		}
	}

	cout << count << endl;

	return 0;
}